<template>
    <div class="header_container">

		<el-breadcrumb separator="/">
			<el-breadcrumb-item :to="{ path: '/Manage2' }">首页</el-breadcrumb-item>
			<el-breadcrumb-item v-for="(item, index) in $route.meta" :key="index">{{item}}</el-breadcrumb-item>
		</el-breadcrumb>
		<el-dropdown @command="handleCommand" menu-align='start'>
			<el-avatar class="avator"> user </el-avatar>
			<el-dropdown-menu slot="dropdown">
				<el-dropdown-item command="home">首页</el-dropdown-item>
				<el-dropdown-item command="signout">退出</el-dropdown-item>
			</el-dropdown-menu>
		</el-dropdown>
    </div>
</template>

<script>
	// import {baseImgPath} from '@/config/env'
	// import {mapActions, mapState} from 'vuex'

    export default {
    	data(){
    		return {
    		}
    	},
    	created(){
    		// if (!this.adminInfo.id) {
    		// 	this.getAdminData()
    		// }
    	},
    	// computed: {
    	// 	...mapState(['adminInfo']),
    	// },
		methods: {
			// ...mapActions(['getAdminData']),
			// async
			 handleCommand(command) {
				if (command == 'home') {
					this.$router.push('/Manage2');
				}else if(command == 'signout'){
					this.$router.push('/');
					// const res = await signout()
					// if (res.status == 1) {
					// 	this.$message({
	                //         type: 'success',
	                //         message: '退出成功'
	                //     });
	                //     this.$router.push('/');
					// }else{
					// 	this.$message({
	                //         type: 'error',
	                //         message: res.message
	                //     });
					// }
				}
			},
		}
    }
</script>

<style lang="less" scoped>
	// @import '../style/mixin';
	.avator{
		border-radius: 50%;
		margin-right: 20px;
	}
	.header_container{
		height: 60px;
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-left: 20px;
	}
	.el-dropdown-menu__item{
        text-align: center;
    }
</style>